<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        ul{
            list-style: none;
        }
        .carousel{
            position: relative;
            width: 600px;
            height: 360px;
            border: 1px solid #cccccc;
            margin:100px auto;
        }
        .carousel ul li{
            position: absolute;
            top:0;
            width: 150px;
            height: 360px;
            /* 启用3D效果展示 */
            transform-style: preserve-3d;
            transition: all 1s ease 0s;
            /* 让图案更加立体 */
            perspective: 5000px;

            /* transform-style: preserve-3d; */
        }
         .carousel ul li:nth-child(1){
            left:0;
            /* background-image: url("image/pic1.jpg"); */
            transition-delay: 0s;
        }
        .carousel ul li:nth-child(2){
            left:150px;
            /* background-image: url("image/pic1.jpg"); */
            /* background-position: -150px 0; */
            transition-delay: .1s;
        }
        .carousel ul li:nth-child(3){
            left:300px;
            /* background-image: url("image/pic1.jpg"); */
            /* background-position: -300px 0; */
            transition-delay: .2s;
        }
        .carousel ul li:nth-child(4){
            left:450px;
            /* background-image: url("image/pic1.jpg"); */
            /* background-position: -450px 0; */
            transition-delay: .3s;
        }
        .carousel ul li div{
            position: absolute;
            top:0;
            left: 0;
            width: 100%;
            height: 360px;
            background-size: 600px 360px;
        }
        .carousel ul li div:nth-child(1){
            background-image: url("image/pic1.jpg");
            transform: rotateX(0deg) translateZ(180px);
        }
        .carousel ul li div:nth-child(2){
            background-image: url("image/pic2.jpg");
            transform: rotateX(90deg) translateZ(180px);
        }
        .carousel ul li div:nth-child(3){
            background-image: url("image/pic3.jpg");
            transform: rotateX(180deg) translateZ(180px);
        }
        .carousel ul li div:nth-child(4){
            background-image: url("image/pic4.jpg");
            transform: rotateX(270deg) translateZ(180px);
        }
        .carousel ul li:nth-child(1) div{
            background-position: 0 0;
        }
        .carousel ul li:nth-child(2) div{
            background-position: -150px 0;
        }
        .carousel ul li:nth-child(3) div{
            background-position: -300px 0;
        }
        .carousel ul li:nth-child(4) div{
            background-position: -450px 0;
        }
    </style>
</head>
<body>
    <div class="carousel">
        <ul>
            <li>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
            </li>
            <li>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
            </li>
            <li>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
            </li>
            <li>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
            </li>
        </ul>
    </div>
    <input type="button" class="btn" value="下一页">
    <script src="lib/jquery-3.3.1.min.js"></script>
    <script>
        var btn = $(".btn");
        var lis = $(".carousel ul li");
        // 定义信号量
        var sub = 0;
        // 定义锁的状态
        var lock = false;

        btn.click(function(){
            if(lock) return;
            lock = true;
            sub -= 90;
            lis.css({
                "transform":"rotateX("+sub+"deg)"
            });
            var timer = (1+0.1*lis.length)*1000;
            // 开启定时器
            setTimeout(function(){
                lock = false;
            },timer);
        });
    </script>
</body>
</html>